<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>IFE JavaScript Task 01</title>
	</head>

	<body>

		<label>请输入北京今天空气质量：<input id="aqi-input" type="text"></label>
		<button id="button">确认填写</button>

		<div>您输入的值是：<span id="aqi-display">尚无录入</span></div>

		<script type="text/javascript">
			function showText() {
				var but = document.getElementById("button");
				but.onclick = function() {
					var desc = document.getElementById("aqi-input").value;
					var textArea = document.getElementById("aqi-display");
					textArea.lastChild.nodeValue = desc;
					console.log(textArea.lastChild);
					console.log(desc);
				}
			}
			window.onload = showText();
		</script>
	</body>

</html>